/**
 *  ComicFileFilter.java 
 *  Description: A class which is used as a file filter to locate comic book archive files
 *
 *  Author: Calvin Moody
 *  Date: 7/3/2011
 *
 */

package ACV;

import javax.swing.filechooser.FileFilter;
import java.io.*;

public class ComicFileFilter extends FileFilter
{
    /** Tells the filter which files to accept
     * @param f File object to process
     * @return returns true if it is a comic book archive file
     */    
    @Override
    public boolean accept(File f)
    {
        if (f.getName().toLowerCase().endsWith(".zip") || f.getName().toLowerCase().endsWith(".cbz") || f.isDirectory()) {
            return true;
        } else {
            return false;
        }
    }
    
    /** Description of what this filter is filtering for
     * @return returns a description of what this class is filtering for
     */    
    @Override
    public String getDescription()
    {
        return "Comic Book Archive";
    }
}
